﻿<UserControl
	x:Class="Presentation.MoneyField.Silverlight.MainPage"

	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	
	xmlns:View="clr-namespace:It3xl.FormattedInput.View;assembly=It3xl.FormattedInput"
	xmlns:ViewModel="clr-namespace:Presentation.MoneyField.Silverlight.ViewModel"
	
	mc:Ignorable="d"
	d:DesignHeight="300"
	d:DesignWidth="400"
	>


	<UserControl.DataContext>
		<ViewModel:ViewModelForTests/>
	</UserControl.DataContext>


	<UserControl.Resources>
		<Style TargetType="View:MoneyTextBox">
			<Setter Property="Width" Value="300"/>
		</Style>
	</UserControl.Resources>

	<ScrollViewer
		HorizontalScrollBarVisibility="Auto"
		VerticalScrollBarVisibility="Auto"
		>
		<StackPanel>

			<Border
				BorderThickness="2"
				BorderBrush="LightSteelBlue"
				Background="Lavender"
				Margin="2"
				Padding="2"
				HorizontalAlignment="Left"
				>
				<StackPanel HorizontalAlignment="Left">

					<TextBlock Text="Presentation.MoneyField.Silverlight" FontWeight="Bold"/>
					<Grid Margin="6"/>

					
					<TextBlock Text="Double" Foreground="Red" FontWeight="Bold"/>
					<RichTextBlock>
						<Paragraph>
							DecimalSeparatorChar = '.'
							<LineBreak/>
							DecimalSeparatorAlternativeChar = ','
							<LineBreak/>
							GroupSeparatorChar = ' ' (not '')
						</Paragraph>
					</RichTextBlock>
					<View:MoneyTextBox
						Text="{Binding DoubleMoney}"
						
						DecimalSeparatorChar = '.'
						DecimalSeparatorAlternativeChar = ','
						GroupSeparatorChar = ' '
						
						Margin="2"
						BorderBrush="SteelBlue"
						BorderThickness="2"
					/>

					<Grid Margin="2"/>

					<TextBlock Text="Decimal" Foreground="Red" FontWeight="Bold"/>
					<RichTextBlock>
						<Paragraph>
							<Bold>PartialDisabledOnInput="True"</Bold>
							<LineBreak/>
							DecimalSeparatorChar = '.'
							<LineBreak/>
							DecimalSeparatorAlternativeChar = ','
							<LineBreak/>
							GroupSeparatorChar = ' ' (not '')
						</Paragraph>
					</RichTextBlock>
					<View:MoneyTextBox
						Text="{Binding DecimalMoney}"
						
						PartialDisabledOnInput="True"
						
						DecimalSeparatorChar = '.'
						DecimalSeparatorAlternativeChar = ','
						GroupSeparatorChar = ' '
						
						Margin="2"
						BorderBrush="SteelBlue"
						BorderThickness="2"
					/>

					<Grid Margin="2"/>

					<TextBlock Text="Double" Foreground="Red" FontWeight="Bold"/>
					<RichTextBlock>
						<Paragraph>
							<Bold>PartialDisabled="True"</Bold>
							<LineBreak/>
							DecimalSeparatorChar = '.'
							<LineBreak/>
							DecimalSeparatorAlternativeChar = ','
							<LineBreak/>
							GroupSeparatorChar = ' ' (not '')
						</Paragraph>
					</RichTextBlock>
					<View:MoneyTextBox
						Text="{Binding DoubleMoneyTwo}"
						
						PartialDisabled="True"
						
						DecimalSeparatorChar = '.'
						DecimalSeparatorAlternativeChar = ','
						GroupSeparatorChar = ' '
						
						Margin="2"
						BorderBrush="SteelBlue"
						BorderThickness="2"
					/>

					<Grid Margin="2"/>

					<TextBlock Text="Nullable{Double}" Foreground="Red" FontWeight="Bold"/>
					<RichTextBlock>
						<Paragraph>
							DecimalSeparatorChar = '.'
							<LineBreak/>
							DecimalSeparatorAlternativeChar = ','
							<LineBreak/>
							GroupSeparatorChar = ' ' (not '')
						</Paragraph>
					</RichTextBlock>
					<View:MoneyTextBox
						Text="{Binding DoubleNullableMoney}"
						
						DecimalSeparatorChar = '.'
						DecimalSeparatorAlternativeChar = ','
						GroupSeparatorChar = ' '
						
						Margin="2"
						BorderBrush="LightSteelBlue"
						BorderThickness="2"
					/>

					<Grid Margin="2"/>

					<TextBlock Text="Nullable{Decimal}" Foreground="Red" FontWeight="Bold"/>
					<RichTextBlock>
						<Paragraph>
							<Bold>PartialDisabledOnInput="True"</Bold>
							<LineBreak/>
							DecimalSeparatorChar = '.'
							<LineBreak/>
							DecimalSeparatorAlternativeChar = ','
							<LineBreak/>
							GroupSeparatorChar = ' ' (not '')
						</Paragraph>
					</RichTextBlock>
					<View:MoneyTextBox
						Text="{Binding DecimalNullableMoney}"
						
						PartialDisabledOnInput="True"
						
						DecimalSeparatorChar = '.'
						DecimalSeparatorAlternativeChar = ','
						GroupSeparatorChar = ' '
						
						Margin="2"
						BorderBrush="LightSteelBlue"
						BorderThickness="2"
					/>

					<Grid Margin="2"/>

				</StackPanel>
			</Border>


			<StackPanel Orientation="Horizontal">
				<Button Margin="2" Content="Set Randov Value" Click="SetAmountRandomButton_Click" />
				<Button Margin="2" Content="Set Default Value" Click="SetDefaultValueButton_Click" />
			</StackPanel>

		</StackPanel>
	</ScrollViewer>


</UserControl>
